<template>
  <div class="box lowcode">
    <div class="head">
      <EditHeader />
    </div>
    <div class="body">
      <div class="left" :style="{ width: leftWidth }">
        <MaterialList />
      </div>
      <div class="center" :style="{ width: `calc(100vw - ${centerWidth}px )` }">
        <EditCanvas />
      </div>
      <div class="right" :style="{ width: rightWidth }">
        <ConfigSide />
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'll-edit'
}
</script>
<script setup>
import { computed } from "vue"
import { useStore } from "vuex"
import EditCanvas from "./component/EditCanvas/index.vue"
import MaterialList from "./component/MaterialList/index.vue"
import ConfigSide from "./component/ConfigSide/index.vue"
import EditHeader from "./component/EditHeader/index.vue"

const store = useStore()

const leftWidth = computed(() => store.getters["chartLayoutStore/leftWidth"])
const rightWidth = computed(() => store.getters["chartLayoutStore/rightWidth"])
const centerWidth = computed(
  () => parseInt(leftWidth.value) + parseInt(rightWidth.value)
)
</script>

<style lang="scss" scoped>
$height: 50px;

.box {
  width: 100vw;
  height: 100vh;
  // background-image: linear-gradient(120deg, #18181c 0%, #18181c 100%);

  .body {
    height: calc(100% - $height);
    display: flex;
    justify-content: space-between;
    user-select: none;

    // .left {
    //   width: 250px;
    // }
    // .right {
    //   width: 250px;
    // }
    .center {
      // width: calc(100vw - 500px);
      height: 100%;
      background-color: #fff;
    }
  }
}
</style>
